package com.resttest.ljs.controller;


import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.resttest.ljs.entity.Stu;
import org.omg.CORBA.MARSHAL;
import org.springframework.boot.context.properties.bind.BindResult;
import org.springframework.stereotype.Controller;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;
import java.math.BigDecimal;
import java.util.*;
import java.util.stream.Collectors;

@Controller
public class YanzhengController {

        @RequestMapping("/addStu")
        @ResponseBody
        public String addStu(@Valid Stu stu, BindingResult bindingResult) {
                if (bindingResult.hasErrors()) {
                        return bindingResult.getAllErrors().get(0).getDefaultMessage();
                }
                System.out.println(stu);
                return "新增成功";
        }

//        public static void main(String[] args) {
//             String yiqi="[\n" +
//                     "    {\n" +
//                     "        \"xtsphm\": \"332065220400014167\",\n" +
//                     "        \"htbh\": \"13206231100202204026\",\n" +
//                     "        \"nsrmc\": \"丛琳琳,徐东明\",\n" +
//                     "        \"sjje\": 4780.56,\n" +
//                     "        \"dzsphm\": \"332066220400075441\",\n" +
//                     "        \"jsyj\": 478055.86,\n" +
//                     "        \"kjrq\": \"2022-04-11\",\n" +
//                     "        \"skssqq\": \"2022-04-11\",\n" +
//                     "        \"lrrDm\": \"53206230025\",\n" +
//                     "        \"kssl\": \"81.64\",\n" +
//                     "        \"nsrsbh\": \"320623198603207827,320623198610307850\",\n" +
//                     "        \"skssqz\": \"2022-04-11\",\n" +
//                     "        \"tpr\": \"潘李媛\",\n" +
//                     "        \"bz\": \" 共有人：徐东明，丛琳琳  房源编号:F32062320220002478 房屋产权证书号:苏(2016)如东县不动产权第0000368号 房屋坐落地址:马塘镇培英路8号文锦佳苑1幢303室 交易面积:81.64平米 合同日期:2022-04-11,\",\n" +
//                     "        \"pzhm\": \"332065220400014167\",\n" +
//                     "        \"yjse\": 0.0\n" +
//                     "    },\n" +
//                     "    {\n" +
//                     "        \"xtsphm\": \"332065220400015153\",\n" +
//                     "        \"htbh\": \"13206231100202204026\",\n" +
//                     "        \"nsrmc\": \"史树仁,王德兰\",\n" +
//                     "        \"sjje\": 4780.56,\n" +
//                     "        \"dzsphm\": \"332066220400080793\",\n" +
//                     "        \"jsyj\": 478055.86,\n" +
//                     "        \"kjrq\": \"2022-04-11\",\n" +
//                     "        \"skssqq\": \"2022-04-11\",\n" +
//                     "        \"lrrDm\": \"53206230025\",\n" +
//                     "        \"kssl\": \"0.0\",\n" +
//                     "        \"nsrsbh\": \"320623195801310039,320623195711250028\",\n" +
//                     "        \"skssqz\": \"2022-04-11\",\n" +
//                     "        \"tpr\": \"潘李媛\",\n" +
//                     "        \"bz\": \" 共有人：王德兰，史树仁  房源编号:F32062320220002478 房屋产权证书号:苏(2016)如东县不动产权第0000368号 房屋坐落地址:马塘镇培英路8号文锦佳苑1幢303室 交易面积:81.64平米 合同日期:2022-04-11,\",\n" +
//                     "        \"pzhm\": \"332065220400015153\",\n" +
//                     "        \"yjse\": 0.0\n" +
//                     "    }\n" +
//                     "]";
//
//             String  fenkai="[\n" +
//                     "    {\n" +
//                     "        \"xtsphm\": \"332055220400022579\",\n" +
//                     "        \"htbh\": \"0154590\",\n" +
//                     "        \"nsrmc\": \"朱启程\",\n" +
//                     "        \"sjje\": 10.6,\n" +
//                     "        \"dzsphm\": \"332056220400290487\",\n" +
//                     "        \"jsyj\": 42351.19,\n" +
//                     "        \"kjrq\": \"2022-04-11\",\n" +
//                     "        \"skssqq\": \"2022-04-11\",\n" +
//                     "        \"lrrDm\": \"23205001868\",\n" +
//                     "        \"kssl\": \"null\",\n" +
//                     "        \"nsrsbh\": \"320582199609200334\",\n" +
//                     "        \"skssqz\": \"2022-04-11\",\n" +
//                     "        \"tpr\": \"黄熙莹\",\n" +
//                     "        \"bz\": \"  房源编号:F32058220220015715 房屋坐落地址:杨舍镇中凯城市之光花园A区地下汽车位幢C0727 () 交易面积:5.935平米 合同日期:2022-03-28,储藏室面积:0.0平方米阁楼面积:0.0平方米车库面积:0.0平方米\",\n" +
//                     "        \"pzhm\": \"332055220400022579\",\n" +
//                     "        \"yjse\": 0.0\n" +
//                     "    },\n" +
//                     "    {\n" +
//                     "        \"xtsphm\": \"332055220400022579\",\n" +
//                     "        \"htbh\": \"0154590\",\n" +
//                     "        \"nsrmc\": \"朱启程\",\n" +
//                     "        \"sjje\": 1270.54,\n" +
//                     "        \"dzsphm\": \"332056220400290487\",\n" +
//                     "        \"jsyj\": 42351.19,\n" +
//                     "        \"kjrq\": \"2022-04-11\",\n" +
//                     "        \"skssqq\": \"2022-04-11\",\n" +
//                     "        \"lrrDm\": \"23205001868\",\n" +
//                     "        \"kssl\": \"5.935\",\n" +
//                     "        \"nsrsbh\": \"320582199609200334\",\n" +
//                     "        \"skssqz\": \"2022-04-11\",\n" +
//                     "        \"tpr\": \"黄熙莹\",\n" +
//                     "        \"bz\": \"  房源编号:F32058220220015715 房屋坐落地址:杨舍镇中凯城市之光花园A区地下汽车位幢C0727 () 交易面积:5.935平米 合同日期:2022-03-28,储藏室面积:0.0平方米阁楼面积:0.0平方米车库面积:0.0平方米\",\n" +
//                     "        \"pzhm\": \"332055220400022579\",\n" +
//                     "        \"yjse\": 0.0\n" +
//                     "    },\n" +
//                     "    {\n" +
//                     "        \"xtsphm\": \"332055220400029421\",\n" +
//                     "        \"htbh\": \"0154590\",\n" +
//                     "        \"nsrmc\": \"朱益锋\",\n" +
//                     "        \"sjje\": 10.6,\n" +
//                     "        \"dzsphm\": \"332056220400290486\",\n" +
//                     "        \"jsyj\": 42351.19,\n" +
//                     "        \"kjrq\": \"2022-04-11\",\n" +
//                     "        \"skssqq\": \"2022-04-11\",\n" +
//                     "        \"lrrDm\": \"23205001868\",\n" +
//                     "        \"kssl\": \"null\",\n" +
//                     "        \"nsrsbh\": \"320582197010057317\",\n" +
//                     "        \"skssqz\": \"2022-04-11\",\n" +
//                     "        \"tpr\": \"黄熙莹\",\n" +
//                     "        \"bz\": \"  房源编号:F32058220220015715 房屋坐落地址:杨舍镇中凯城市之光花园A区地下汽车位幢C0727 () 交易面积:5.935平米 合同日期:2022-03-28,共有人;常华储藏室面积:0.0平方米阁楼面积:0.0平方米车库面积:0.0平方米\",\n" +
//                     "        \"pzhm\": \"332055220400029421\",\n" +
//                     "        \"yjse\": 0.0\n" +
//                     "    },\n" +
//                     "    {\n" +
//                     "        \"xtsphm\": \"332055220400029421\",\n" +
//                     "        \"htbh\": \"0154590\",\n" +
//                     "        \"nsrmc\": \"朱益锋\",\n" +
//                     "        \"sjje\": 1270.54,\n" +
//                     "        \"dzsphm\": \"332056220400290486\",\n" +
//                     "        \"jsyj\": 42351.19,\n" +
//                     "        \"kjrq\": \"2022-04-11\",\n" +
//                     "        \"skssqq\": \"2022-04-11\",\n" +
//                     "        \"lrrDm\": \"23205001868\",\n" +
//                     "        \"kssl\": \"5.935\",\n" +
//                     "        \"nsrsbh\": \"320582197010057317\",\n" +
//                     "        \"skssqz\": \"2022-04-11\",\n" +
//                     "        \"tpr\": \"黄熙莹\",\n" +
//                     "        \"bz\": \"  房源编号:F32058220220015715 房屋坐落地址:杨舍镇中凯城市之光花园A区地下汽车位幢C0727 () 交易面积:5.935平米 合同日期:2022-03-28,共有人;常华储藏室面积:0.0平方米阁楼面积:0.0平方米车库面积:0.0平方米\",\n" +
//                     "        \"pzhm\": \"332055220400029421\",\n" +
//                     "        \"yjse\": 0.0\n" +
//                     "    },\n" +
//                     "    {\n" +
//                     "        \"xtsphm\": \"332055220400039356\",\n" +
//                     "        \"htbh\": \"0154590\",\n" +
//                     "        \"nsrmc\": \"杜培鑫\",\n" +
//                     "        \"sjje\": 297.62,\n" +
//                     "        \"dzsphm\": \"332056220400298916\",\n" +
//                     "        \"jsyj\": 5952.38,\n" +
//                     "        \"kjrq\": \"2022-04-11\",\n" +
//                     "        \"skssqq\": \"2022-04-11\",\n" +
//                     "        \"lrrDm\": \"23205001868\",\n" +
//                     "        \"kssl\": \"null\",\n" +
//                     "        \"nsrsbh\": \"320582199205165712\",\n" +
//                     "        \"skssqz\": \"2022-04-11\",\n" +
//                     "        \"tpr\": \"黄熙莹\",\n" +
//                     "        \"bz\": \"  房源编号:F32058220220015715 房屋坐落地址:杨舍镇中凯城市之光花园A区地下汽车位幢C0727 () 交易面积:11.87平米 合同日期:2022-03-28,\",\n" +
//                     "        \"pzhm\": \"332055220400039356\",\n" +
//                     "        \"yjse\": 0.0\n" +
//                     "    },\n" +
//                     "    {\n" +
//                     "        \"xtsphm\": \"332055220400039356\",\n" +
//                     "        \"htbh\": \"0154590\",\n" +
//                     "        \"nsrmc\": \"杜培鑫\",\n" +
//                     "        \"sjje\": 1932.67,\n" +
//                     "        \"dzsphm\": \"332056220400298916\",\n" +
//                     "        \"jsyj\": 9663.34,\n" +
//                     "        \"kjrq\": \"2022-04-11\",\n" +
//                     "        \"skssqq\": \"2022-04-11\",\n" +
//                     "        \"lrrDm\": \"23205001868\",\n" +
//                     "        \"kssl\": \"null\",\n" +
//                     "        \"nsrsbh\": \"320582199205165712\",\n" +
//                     "        \"skssqz\": \"2022-04-11\",\n" +
//                     "        \"tpr\": \"黄熙莹\",\n" +
//                     "        \"bz\": \"  房源编号:F32058220220015715 房屋坐落地址:杨舍镇中凯城市之光花园A区地下汽车位幢C0727 () 交易面积:11.87平米 合同日期:2022-03-28,\",\n" +
//                     "        \"pzhm\": \"332055220400039356\",\n" +
//                     "        \"yjse\": 0.0\n" +
//                     "    },\n" +
//                     "    {\n" +
//                     "        \"xtsphm\": \"332055220400039356\",\n" +
//                     "        \"htbh\": \"0154590\",\n" +
//                     "        \"nsrmc\": \"杜培鑫\",\n" +
//                     "        \"sjje\": 10.41,\n" +
//                     "        \"dzsphm\": \"332056220400298916\",\n" +
//                     "        \"jsyj\": 297.62,\n" +
//                     "        \"kjrq\": \"2022-04-11\",\n" +
//                     "        \"skssqq\": \"2022-04-11\",\n" +
//                     "        \"lrrDm\": \"23205001868\",\n" +
//                     "        \"kssl\": \"null\",\n" +
//                     "        \"nsrsbh\": \"320582199205165712\",\n" +
//                     "        \"skssqz\": \"2022-04-11\",\n" +
//                     "        \"tpr\": \"黄熙莹\",\n" +
//                     "        \"bz\": \"  房源编号:F32058220220015715 房屋坐落地址:杨舍镇中凯城市之光花园A区地下汽车位幢C0727 () 交易面积:11.87平米 合同日期:2022-03-28,\",\n" +
//                     "        \"pzhm\": \"332055220400039356\",\n" +
//                     "        \"yjse\": 0.0\n" +
//                     "    },\n" +
//                     "    {\n" +
//                     "        \"xtsphm\": \"332055220400039356\",\n" +
//                     "        \"htbh\": \"0154590\",\n" +
//                     "        \"nsrmc\": \"杜培鑫\",\n" +
//                     "        \"sjje\": 21.2,\n" +
//                     "        \"dzsphm\": \"332056220400298916\",\n" +
//                     "        \"jsyj\": 84702.38,\n" +
//                     "        \"kjrq\": \"2022-04-11\",\n" +
//                     "        \"skssqq\": \"2022-04-11\",\n" +
//                     "        \"lrrDm\": \"23205001868\",\n" +
//                     "        \"kssl\": \"null\",\n" +
//                     "        \"nsrsbh\": \"320582199205165712\",\n" +
//                     "        \"skssqz\": \"2022-04-11\",\n" +
//                     "        \"tpr\": \"黄熙莹\",\n" +
//                     "        \"bz\": \"  房源编号:F32058220220015715 房屋坐落地址:杨舍镇中凯城市之光花园A区地下汽车位幢C0727 () 交易面积:11.87平米 合同日期:2022-03-28,\",\n" +
//                     "        \"pzhm\": \"332055220400039356\",\n" +
//                     "        \"yjse\": 0.0\n" +
//                     "    },\n" +
//                     "    {\n" +
//                     "        \"xtsphm\": \"332055220400039356\",\n" +
//                     "        \"htbh\": \"0154590\",\n" +
//                     "        \"nsrmc\": \"杜培鑫\",\n" +
//                     "        \"sjje\": 4.46,\n" +
//                     "        \"dzsphm\": \"332056220400298916\",\n" +
//                     "        \"jsyj\": 297.62,\n" +
//                     "        \"kjrq\": \"2022-04-11\",\n" +
//                     "        \"skssqq\": \"2022-04-11\",\n" +
//                     "        \"lrrDm\": \"23205001868\",\n" +
//                     "        \"kssl\": \"null\",\n" +
//                     "        \"nsrsbh\": \"320582199205165712\",\n" +
//                     "        \"skssqz\": \"2022-04-11\",\n" +
//                     "        \"tpr\": \"黄熙莹\",\n" +
//                     "        \"bz\": \"  房源编号:F32058220220015715 房屋坐落地址:杨舍镇中凯城市之光花园A区地下汽车位幢C0727 () 交易面积:11.87平米 合同日期:2022-03-28,\",\n" +
//                     "        \"pzhm\": \"332055220400039356\",\n" +
//                     "        \"yjse\": 0.0\n" +
//                     "    },\n" +
//                     "    {\n" +
//                     "        \"xtsphm\": \"332055220400039357\",\n" +
//                     "        \"htbh\": \"0154590\",\n" +
//                     "        \"nsrmc\": \"杜培鑫\",\n" +
//                     "        \"sjje\": 2.97,\n" +
//                     "        \"dzsphm\": \"332056220400298916\",\n" +
//                     "        \"jsyj\": 297.62,\n" +
//                     "        \"kjrq\": \"2022-04-11\",\n" +
//                     "        \"skssqq\": \"2022-04-11\",\n" +
//                     "        \"lrrDm\": \"23205001868\",\n" +
//                     "        \"kssl\": \"null\",\n" +
//                     "        \"nsrsbh\": \"320582199205165712\",\n" +
//                     "        \"skssqz\": \"2022-04-11\",\n" +
//                     "        \"tpr\": \"黄熙莹\",\n" +
//                     "        \"bz\": \"  房源编号:F32058220220015715 房屋坐落地址:杨舍镇中凯城市之光花园A区地下汽车位幢C0727 () 交易面积:11.87平米 合同日期:2022-03-28,\",\n" +
//                     "        \"pzhm\": \"332055220400039357\",\n" +
//                     "        \"yjse\": 0.0\n" +
//                     "    }\n" +
//                     "]";
//                List<Map<String,Object>> wsxxList = new ArrayList<>();
//                wsxxList=(List) JSON.parseArray(yiqi,Map.class);
//                String nsrsbhStr="";
//                for (Map<String, Object> map : wsxxList) {
//                        nsrsbhStr += map.get("nsrsbh")+",";
//                }
//                System.out.println(nsrsbhStr);
//                List<String> list=new ArrayList();
//                list.add("320623198603207827");
//                list.add("320623198610307850");
//                list.add("123");
//                for (String s : list) {
//                        if(!nsrsbhStr.contains(s)){
//                                System.out.println("retuen");
//                        }
//                }
//
//        }


        public static void main(String[] args) {
                String htbh="13206231000202204035";
                System.out.println(htbh.substring(1,5));
        }

}

